
<%@ page import="net.tribal.comic.entities.Note" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="note.create" default="Create Note" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="note.list" default="Note List" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="note.create" default="Create Note" /></h1>

            <g:form action="save" method="post" >
                <div class="roundedCorners wrapper dialog">
                	<g:hasErrors bean="${noteInstance}">
			            <div class="errors"><g:renderErrors bean="${noteInstance}" as="list" /></div>
		            </g:hasErrors>
                
                    <table>
                        <tbody>
                            <tr>
                                <td class="${hasErrors(bean: noteInstance, field: 'title', 'errors')}">
                                	<label for="title"><g:message code="note.title" default="Title" />:</label>
                                    <g:textField name="title" maxlength="100" value="${fieldValue(bean: noteInstance, field: 'title')}" />
                                </td>
                                <td class="${hasErrors(bean: noteInstance, field: 'disabled', 'errors')}">
                                	<label for="disabled"><g:message code="note.disabled" default="Disabled" />:</label>
                                    <g:checkBox name="disabled" value="${noteInstance?.disabled}" />
                                </td>
                            </tr>
                        
                            <tr>
                                <td colspan="2" class="${hasErrors(bean: noteInstance, field: 'text', 'errors')}">
									<richui:richTextEditor name="text" value="${noteInstance?.text}" width="600" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="buttons">
                    	<span class="button"><g:submitButton name="create" class="save" value="${message(code: 'create', 'default': 'Create')}" /></span>
                	</div>
                </div>
            </g:form>
        </div>
    </body>
</html>
